Refactor MediaWikiIntegrationTestCase::resetDB() for readability
This was inspired by I1b2a6eb. As far as I can tell this patch does not
change anything in terms of behavior. My main motivation was to get rid
of the (possibly confusing) duplications, and turn them into a loop.
The special case where TestUserRegistry::clear() is executed appears like
it might not do the exact same as before, but I'm pretty sure it does.
Before, the special case was executed whenever any of the user tables was
present in the $tablesUsed array originally passed to the method. The
same still happens.
Additional changes:
* Strict type hints in the method signature.
Change-Id: I7f292095c0dac99b9cc0b0aa5ce10703f24f8bba